package com.yzh.luckydraw.infrastructure.dao;

import com.yzh.luckydraw.infrastructure.po.StrategyDetail;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * 策略表数据库操作
 */
@Mapper
public interface IStrategyDetailDao {
    /**
     * 查询策略表详细配置
     * @param strategyId
     * @return
     */
    List<StrategyDetail> queryStrategyDetailList(Long strategyId);

    /**
     * 查询库存为空的奖品
     * @param strategyId
     * @return
     */
    List<String> queryNoStockStrategyAwardList(Long strategyId);

    /**
     * 扣减库存
     * @param strategyDetail 策略ID、奖品ID
     * @return
     */
    int deductStock(StrategyDetail strategyDetail);

    /**
     * 插入策略明细集合
     * @param strategyDetailList
     */
    void insertList(List<StrategyDetail> strategyDetailList);
    
}
